/**══════════════════════════════════╗
*作    者：songbaobao                                                 ║
*职    业：我以我血荐轩辕                                              ║
*CSND地址：https://blog.csdn.net/weixin_43949535                       ║
**GitHub ：https://github.com/TsinghuaLucky912/My_own_C-_study_and_blog║
**GitEE  ：https://gitee.com/lucky912_admin/code-up_-pat               ║
*═══════════════════════════════════╣
*创建时间：                                                           
*功能描述：                                                            
*                                                                      
*                                                                      
*═══════════════════════════════════╣
*结束时间:                                                           
*═══════════════════════════════════╝
//                .-~~~~~~~~~-._       _.-~~~~~~~~~-.
//            __.'              ~.   .~              `.__
//          .'//              西南\./联大               \\`.
//        .'//                     |                     \\`.
//      .'// .-~"""""""~~~~-._     |     _,-~~~~"""""""~-. \\`.
//    .'//.-"                 `-.  |  .-'                 "-.\\`.
//  .'//______.============-..   \ | /   ..-============.______\\`.
//.'______________________________\|/______________________________`.
*/
#include <iostream>
#include <vector>
#include <string>
#include <unordered_set>
#include <set>
#include <ctype.h>
#include <queue>
#include <list>
#include <map>
#include <math.h>
#include <algorithm>
#include <iomanip>
using namespace std;

#if 0
/**
* 将大写字母组成的字符串 转化为整数
*/
int hashFunc1(string str)
{
	int len = str.length();
	
	if (0 == len)
		return -1;

	int id = 0;
	
	for (string::iterator it = str.begin(); it != str.end(); ++it)
	{
		id = (*it - 'A') + id * 26;
	}
	return id;
}
#endif

int main()
{
#if 0
	vector<int>result(26 * 26 * 26 + 1, 0);

	int n, m;
	cin >> n >> m;

	for (int i = 0; i < n; ++i)
	{
		string str;
		cin >> str;
		result[hashFunc1(str)]++;
	}

	for (int i = 0; i < m; ++i)
	{
		string str;
		cin >> str;
		cout << str << " " << result[hashFunc1(str)] << endl;
	}
#endif

#if A
	int n, m;
	while (cin >> n >> m)
	{
		vector<int>result(501, 0);
		vector<int>person;

		for (int i = 0; i < n; ++i)
		{
			int p;
			cin >> p;
			person.push_back(p);
			result[p]++;
		}
		for (vector<int>::iterator it = person.begin(); it != person.end(); ++it)
		{
			if (result[*it] > 1)
				cout << result[*it] - 1 << endl;
			else
				cout << "BeiJu" << endl;

			/* if (it != person.end() - 1)
				cout << endl; */
		}
	}
#endif

#if B

	int N;
	while (cin >> N)
	{
		while (N--)
		{
			int n;
			cin >> n;
			vector<int>numbers;
			set<int> nums_size;
			for (int i = 0; i < n; ++i)
			{
				int num;
				cin >> num;
				numbers.push_back(num);
				nums_size.insert(num);
			}

			/**
			* k 代表有效的数据个数
			*/
			int k = nums_size.size();

			vector<int>groups;
			set<int> group_size;
			for (int i = 0; i < n; ++i)
			{
				int group;
				cin >> group;
				groups.push_back(group);
				group_size.insert(group);
			}

			/**
			* m 代表有效的组数
			*/
			int m = group_size.size();

			vector<int>group_size_vec;
			for (set<int>::iterator it = group_size.begin(); it != group_size.end(); ++it)
			{
				group_size_vec.push_back(*it);
			}
			sort(group_size_vec.begin(), group_size_vec.end());

			vector<int>nums_size_vec;
			for (set<int>::iterator it = nums_size.begin(); it != nums_size.end(); ++it)
			{
				nums_size_vec.push_back(*it);
			}
			sort(nums_size_vec.begin(), nums_size_vec.end());

			int max_group = group_size_vec[group_size_vec.size() - 1];
			int max_num = nums_size_vec[nums_size_vec.size() - 1];

			vector<vector<int>>result(max_group + 1, vector<int>(max_num + 1, 0));
			for (int i = 0; i < n; ++i)
			{
				int row = groups[i];
				int col = numbers[i];
				result[row][col]++;
			}

			for (vector<int>::iterator it = group_size_vec.begin(); it != group_size_vec.end(); ++it)
			{
				cout << *it << "={";
				int i = 0;
				for (vector<int>::iterator it1 = nums_size_vec.begin(); it1 != nums_size_vec.end(); ++it1)
				{
					//int myrow = groups[*it];
					//int mycol = numbers[*it1];
					cout << *it1 << "=" << result[*it][*it1];
					++i;

					if (i != k)
						cout << ",";
				}
				cout << "}" << endl;
			}
		}
	}
#endif

#if C
	int N;
	while (cin >> N)
	{
		vector<int>myvec;
		vector<int>flagVec(10010, 0);
		int item;
		bool find = false;
		for (int i = 0; i < N; ++i)
		{
			cin >> item;
			myvec.push_back(item);
			flagVec[item]++;
		}
		for (vector<int>::iterator it = myvec.begin(); it != myvec.end(); ++it)
		{
			if (flagVec[*it] == 1)
			{
				cout << *it << endl;
				find = true;
				break;
			}
		}
		if (!find)
		{
			cout << "None" << endl;
		}
	}
#endif

	string str1;
	string str2;

	while (getline(cin, str1), getline(cin, str2))
	{
		vector<bool>myvec(128, false);
		for (string::iterator it = str2.begin(); it != str2.end(); ++it)
		{
			int ascl = *it;
			myvec[ascl] = true;
		}
		for (int i = 0; i < str1.size(); ++i)
		{
			int ascl = str1[i];
			if (myvec[ascl] == false)
			{
				cout << str1[i];
			}
		}
		cout << endl;
	}

	return 0;
}
/**
*备用注释：
*
*
*
*/
